home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
001-100
/
001-025
/
019
/
blackjack
/
getbet.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-17
|
639b
|
34 lines
/* GETBET.C Get the player's bet
*/
#include "local.h"
#include "bj.h"
#define MINBET 2
#define MAXBET 1000
CASH getbet()
{
int sscanf();
char line[BUFSIZ]; /* input line */
short retn; /* return from getln and sscanf */
CASH bet; /* player's bet */
printf("\n\nYour bet (amount): ");
FOREVER {
retn = getln(line, BUFSIZ);
if (retn == EOF)
return(0);
retn = sscanf(line, CASHIN, &bet);
if (retn != 1 || bet < MINBET || MAXBET < bet)
printf("Number from %d to %d please: ", MINBET, MAXBET);
else
return(bet);
}
}